There are three ways to write out a file header that has been read in.
The first and easiest is to specify a file descriptor _o_u_t in the
ssssaaaatttt____rrrreeeeaaaadddd____ffffiiiilllleeee____iiiinnnnffffoooo call. If output is not required, use NULL for this
value. The second method is to ask for the disk image using SSSSFFFFIIII____BBBBUUUUFFFFFFFFEEEERRRR
in the mask. When output is desired, use ffffwwwwrrrriiiitttteeee(3C) to write the
contents of ssssaaaatttt____bbbbuuuuffffffffeeeerrrr to disk. The length of the data in ssssaaaatttt____bbbbuuuuffffffffeeeerrrr is
in ssssaaaatttt____ffffhhhhddddrrrrssssiiiizzzzeeee. The third method is to call ssssaaaatttt____wwwwrrrriiiitttteeee____ffffiiiilllleeee____iiiinnnnffffoooo, which
is more computationally expensive, and can only be used for the most
current file version. Calling ssssaaaatttt____wwwwrrrriiiitttteeee____ffffiiiilllleeee____iiiinnnnffffoooo is only advisable if
some data in the header has been changed.
ssssaaaatttt____ffffrrrreeeeeeee____ffffiiiilllleeee____iiiinnnnffffoooo is used to free any data that ssssaaaatttt____rrrreeeeaaaadddd____ffffiiiilllleeee____iiiinnnnffffoooo
allocated while constructing a ssssaaaatttt____ffffiiiilllleeee____iiiinnnnffffoooo struct. It does not free
the struct itself, only certain fields within the struct. To make sure
the struct isn't used afterwards, it is zeroed after all the fields are
freed.
DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
ssssaaaatttt____rrrreeeeaaaadddd____ffffiiiilllleeee____iiiinnnnffffoooo returns SSSSFFFFIIII____OOOOKKKKAAAAYYYY on success, SSSSFFFFIIII____WWWWAAAARRRRNNNNIIIINNNNGGGG if there was
no file header to be read, or SSSSFFFFIIII____EEEERRRRRRRROOOORRRR if any errors were detected.
ssssaaaatttt____wwwwrrrriiiitttteeee____ffffiiiilllleeee____iiiinnnnffffoooo returns SSSSFFFFIIII____OOOOKKKKAAAAYYYY on success, or SSSSFFFFIIII____EEEERRRRRRRROOOORRRR if any